package com.ygqh.baby.service;

import com.ygqh.baby.ao.ContractStatus;
import com.ygqh.baby.ao.Message;
import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.ao.ResultSet;
import com.ygqh.baby.po.AdminContract;
import com.ygqh.baby.po.AdminContractDetail;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface AdminContractService {

	List<AdminContract> find();

	int findCount();

	AdminContract findById(Long id);

	AdminContract findByCode(String code);

	int deleteSoft(Long[] ids);

	int deleteSoft(Long id);

	int save(AdminContract adminContract, String operator);

	int update(AdminContract adminContract, String operator);

	int update(AdminContract adminContrac);

	int saveOrUpdate(AdminContract adminContract, String operator);

	ResultSet<AdminContract> search(QueryInfo queryInfo, String q, Date startDate, Date endDate, ContractStatus contractStatus,
									String contractType,String productName,String contractCode, String skuCode);

	/**
	 * 查找合同列表通过 供应商id
	 *
	 * @param supplierId
	 * @return
	 */
	List<AdminContract> findContractListBySupplier(Long supplierId);

	AdminContract findDetailById(Long id);

	Message deleteContract(Long id, String operator);

	Message updateContractStatus(Long id, String operator, ContractStatus contractStatus);

	/**
	 * 更新状态
	 *
	 * @param id
	 * @param operator
	 * @param remark
	 * @return
	 */
	Message updateRemark(Long id, String operator, String remark);

	/**
	 * 合同归档
	 *
	 * @param id
	 * @param operator
	 * @param contractCode
	 * @return
	 */
	Message archivedContract(Long id, String operator, String contractCode);

	/**
	 * 合同作废
	 *
	 * @param id
	 * @param operator
	 * @param remark
	 * @return
	 */
	Message cancelContract(Long id, String operator, String cancelReason);

	/**
	 * 按合同查看合同的结算信息
	 *
	 * @param queryInfo
	 * @param
	 * @return
	 */
	ResultSet<Map<String, Object>> searchContractSettlement(QueryInfo queryInfo, String contractCode, String supplierName, ContractStatus contractStatus);

	List<AdminContractDetail> findDetail(Long cId);

	void setSkuCost(Long contractId);

	String findContractCode(String frameCode);

}
